Skip to content

Create ConnIface interface and generate mock with mockgen #1369

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

cpeliciari
Copy link

I took a look at #656 and became curious as to why we don’t simply ship a generic mock generated with mockgen. In the future, if the community feels it’s necessary, we can improve this mock. It’s also very important to note that we already have a Fake for the library, which helps developers create their unit tests. If you don’t see the need for this PR, feel free to close this was just a suggestion for a mock.

Changes:

  • Created the ConnIface interface aggregating all public methods of *Conn.
  • Generated a mock implementation for ConnIface using mockgen for easier testing.

- Created the ConnIface interface aggregating all public methods of *Conn.
- Generated a mock implementation for ConnIface using mockgen for easier testing.
@petedannemann
Copy link
Contributor

We prefer to test against an actual Kafka implementation. It's less code to maintain and gives us more reassurance on the accuracy. Thank you for the suggestion though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants